package com.sakiko.multimodel.config;

import dev.langchain4j.model.chat.ChatModel;
import dev.langchain4j.model.openai.OpenAiChatModel;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * projectName: com.sakiko.multimodel.config
 *
 * @author: Yang
 * description: 大语言模型配置类
 * time: 2025/8/17 10:17
 */
@Configuration
public class LLMConfig {

    @Bean(name = "qwen")
    public ChatModel chatModelQwen() {
        return OpenAiChatModel.builder()
                .apiKey(System.getenv("ALIBABA_BAILIAN_API_KEY"))
                .modelName("qwen-plus")
                .baseUrl("https://dashscope.aliyuncs.com/compatible-mode/v1")
                .build();
    }

    @Bean(name = "kimi")
    public ChatModel chatModelKimi() {
        return OpenAiChatModel.builder()
                .apiKey(System.getenv("MOONSHOT_API_KEY"))
                .modelName("moonshot-v1-32k")
                .baseUrl("https://api.moonshot.cn/v1")
                .build();
    }

}
